﻿@{
    ViewData["Title"] = "管理中心";
}
@model ArticleIndexViewModel; 
@section PYhead{
    <link href="~/css/Account.css" type="text/css" rel="stylesheet">
    <link href="~/css/Article.css" type="text/css" rel="stylesheet">
    <link href="~/css/user-admin.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="~/js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="~/js/jquery-ui.min.js"></script>
    <style>
        .standardpic {
            max-width: 400px;
        }
        .ar-content{
            background-color:white;
        }
    </style>
}
<div id="topbar-ar">
    <p class="artop-item" style="right:0;left:0;">文章详情</p>
</div>
<div id="main" style="background-color:white">
    <div id="Article-Area">
        <div id="top-inf">
            <p class="title">@Model.Title</p>
            <div id="Uploder">
                <div id="headpic-father">
                    <img class="headpic" src="/Account/GetUserHead/@Model.Uid" alt="头像" />
                </div>
                <ul class="up-inf">
                    <li class="name">@Model.UserName</li>
                    <li class="level">管理</li>
                </ul>
            </div>
        </div>
        <div class="ar-content" id="ar-content">

        </div>
    </div>
</div>
<script>
    var s = "@Model.Content";
    s = s.replace(/\[b\]/g, "<b>");
    s = s.replace(/\[\/b\]/g, "</b>");
    s = s.replace(/\[strike\]/g, "<strike>");
    s = s.replace(/\[\/strike\]/g, "</strike>");
    s = s.replace(/\[u\]/g, "<u>");
    s = s.replace(/\[\/u\]/g, "</u>");
    s = s.replace(/\[i\]/g, "<i>");
    s = s.replace(/\[\/i\]/g, "</i>");
    s = s.replace(/\[div\]/g, "<div>");
    s = s.replace(/\[\/div\]/g, "</div>");
    s = s.replace(/\[br\]/g, "<br>");
    s = s.replace(/\[\/br\]/g, "</br>");
    s = s.replace(/\[space\]/g, "&nbsp;");
    var imgs = /\[img\](.+?)\[\/img\]/g;
    var s2 = s.match(imgs);
    if (s2 != null) {
        s2.forEach(function (value, index, array) {
            var tmp = array[index];
            tmp = tmp.replace(/\[img\]/g, "");
            tmp = tmp.replace(/\[\/img\]/g, "");
            s = s.replace(array[index], "<img class=\"standardpic\" src=\"" + tmp + "\">");
        });
    }
    document.getElementById("ar-content").innerHTML = s;
</script>